package com.harzone.commons.search.domain;


/**
 * 
 * @author ls
 * 2014年11月25日上午10:06:29
 */
public enum FieldType {
	varchar("varchar","_s"),
	//浮点型
	number("number","_d"),
	//整形
	longx("longx","_l"),
	date("date","_dt"),
	file("file","_s"),
	Boolean("Boolean","_s");
	
	private String name = "";
	private String alias = "";
	
	
	FieldType(String name){
		this.name = name;
	}
	
	FieldType(String name,String alias){
		this.name = name;
		this.alias = alias;
	}
	
	public static FieldType get(String name){
		FieldType[] tfs = FieldType.values();
		if("string".equalsIgnoreCase(name)){
			return FieldType.varchar;
		}
		for (FieldType fieldType : tfs) {
			if(fieldType.getName().equalsIgnoreCase(name)){
				return fieldType;
			}
		}
		return null;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getName() {
		return name;
	}

	public void setAlias(String alias) {
		this.alias = alias;
	}

	public String getAlias() {
		return alias;
	}
}
